import React from 'react'


class Event extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            date: new Date(),
        }
    }
    componentDidMount() {
        this.timerID = setInterval(() => this.tick(), 1000);
    }
    componentWillUnmount() {
        clearInterval(this.timerID);
    }
    tick() {
        this.setState({
            date: new Date(),
        })
    }
    activateLasers() {
      alert(111);
    }
    handleClick(e) {
      e.preventDefault();
      alert('------')
      console.log('The link was clicked.');
    }
    render() {
      return <h1>
          <p>
          <button onClick={this.activateLasers}>Activate Lasers</button>
          <a href="#" onClick={this.handleClick}>Click me</a>
          </p>
        </h1>;
      
    }
  }


  export default Event;